package com.crazy.practice.boot.listener;

import com.crazy.practice.boot.even.UserOrderEven;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author panyonghui
 * @describe 自定义用户订单事件监听器
 * @date 2023/4/11 16:34
 */
@Slf4j
@Component
public class UserOrderListener implements ApplicationListener<UserOrderEven> {
    @Override
    public void onApplicationEvent(UserOrderEven userOrderEven) {
        List orderList = (List) userOrderEven.getSource();
        log.info("自定义监听器，监听到事件:{}", orderList);
    }
}
